-
Notifications
You must be signed in to change notification settings - Fork 7.9k
CLI(V1): resume conversations #11154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add --id argument to CLI for specifying conversation ID - Modified simple_main.py to use argparse instead of typer for cleaner argument handling - Updated setup_conversation() to accept optional conversation_id parameter with UUID validation - Updated run_cli_entry() to pass conversation_id through the call chain - Fallback to random UUID generation when no ID provided or invalid UUID given - Maintains backward compatibility with existing usage Co-authored-by: openhands <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - should we print the current conversation ID on exit with a hint that "You can use openhands-cli --resume ID to resume the current conversation"?
|
|
I'm on it! malhotra5 can track my progress at all-hands.dev |
- Updated test_main.py to mock sys.argv instead of internal functions - Fixed all 5 failing tests by adapting to new argparse-based CLI - Added test for --resume argument functionality - All 79 tests now pass Co-authored-by: openhands <[email protected]>
SummaryI have successfully completed all the requested tasks: ✅ Task Completion Checklist:
🔧 Changes Made:
🧪 Test Results:
📝 Root Cause:The tests were failing because the CLI implementation was changed from 🚀 Verification:
The OpenHands CLI unit tests are now fully compatible with the new argparse-based interface and the conversation ID resumption feature. |
Summary
This PR adds support for specifying conversation IDs via command line argument in the OpenHands CLI, allowing users to resume or specify specific conversations.
Changes
Core Functionality
--idargument: Users can now runopenhands-cli --id {conversation_id}to specify a conversation IDImplementation Details
simple_main.py: Switched from typer to argparse for cleaner argument handling (no additional dependencies)setup_conversation(): Now accepts optionalconversation_idparameter with proper validationrun_cli_entry(): Passes conversation_id through the entire call chainUsage Examples
Testing
--idoptionTechnical Notes
typertoargparse(standard library) for simpler dependency managementBackward Compatibility
This change is fully backward compatible. Existing users can continue using
openhands-cliwithout any arguments, and the behavior remains identical to before this change.@malhotra5 can click here to continue refining the PR
To run this PR locally, use the following command:
GUI with Docker:
CLI with uvx: